package com.eqdd.yiqidian.ui.mine.wo;

import android.view.View;

import com.eqdd.yiqidian.bean.EnterBean;
import com.eqdd.yiqidian.box.ItemDecoration.SectionDividerItemDecoration;
import com.eqdd.yiqidian.ui.base.BaseEnterActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.finance.ExpenseSettingActivity;
import com.eqdd.yiqidian.utils.DensityUtil;
import com.eqdd.yiqidian.utils.ToastUtil;

/**
 * Created by lvzhihao on 17-7-18.
 */

public class SafeActivity extends BaseEnterActivity {

    private int[] decoders = new int[]{10};
    private String[] contents = new String[]{
            "修改密码",
            "解绑手机"
    };

    private Class[] classes = new Class[]{
            PassWordUpdateActivity.class,
            UnBindingActivity.class
    };


    @Override
    public void itemClick(int p) {
        if (classes[p] != null) {
            startActivity(classes[p]);
        } else {
            ToastUtil.showShort("该模块暂未开发");
        }
    }

    @Override
    public void initEnterData() {
        initTopTitleBar(View.VISIBLE, "安全");
        isDealCode = true;
        int index = 0;
        for (int i = 0; i < contents.length; i++) {
            EnterBean enterBean = new EnterBean();
            if (i == 0) {
                enterBean.setTop(true);
            }
            if (index < decoders.length && i == decoders[index]) {
                index++;
                enterBean.setBottom(true);
                enterBean.setUnderLine(false);
            }
            enterBean.setContent(contents[i]);
            enterBean.setIcon(false);
            enterBean.setEnter(true);
            enterBeans.add(enterBean);
            dataBinding.recyclerView.addItemDecoration(new SectionDividerItemDecoration(this)
                    .setLeftPadding(DensityUtil.percentW(30))
                    .setRightPadding(DensityUtil.percentW(30)));
        }

    }
}
